com.cete.dynamicpdf.merger
Class PdfDocument



Example : The following example will first merge two entire PDF documents together, then will Append a selected page of a third PDF to the end.
   import com.cete.dynamicpdf.*;
   import com.cete.dynamicpdf.merger.*;
 
   public class MyClass {
     public static void main(String args[]) {
        // Create two PDF document objects
        PdfDocument pdfA = new PdfDocument( "[physicalpatha]/ImportPDF.pdf" );
 
        // The owner's password is required to merge encrypted PDFs
        PdfDocument pdfB = new PdfDocument( "[physicalpath]/EncryptedPDF.pdf", "owner" );
 
        // Merge the two documents
        MergeDocument document= MergeDocument.merge( pdfA, pdfB );
        // Append an additional document
        PdfDocument pdfC = new PdfDocument( "[physicalpath]/MyDocumentC.pdf" );
        document.append( pdfC, 2, 1);
 
        // Save the PDF
        document.draw( "[physicalpath]/MyDocument.pdf" );
     }
   }